#!/usr/bin/tclsh

set log [exec pwd]
append log "/[lindex $argv 0]"
set file [open $log r]

set last_time_stamp 0

while {[gets $file line] >= 0} {
  if { [regexp {[0-9]+\.+[0-9]+} $line time_stamp] == 1 } {
    set process_name $line
    set process_name [string range $line 0 [string first "-" $line]-1]
    set process_name [string range $process_name [string last " " $process_name]+1 end]
#    if { [string first $process_name " "] != -1 } {
#      set process_name [string range 0 [string first $process_name " "]-1]
#    }
#    puts $process_name
    puts "+------------------------------+------------------------------+"
    puts "|[format "%-30s" $process_name]|[format "%30s"  [expr $time_stamp - $last_time_stamp]]|"
    set last_time_stamp $time_stamp
    }
}
puts "+------------------------------+------------------------------+"
